Image reproduction apparatus, control method thereof, program and storage medium

ABSTRACT

An object of this invention is to suppress discontinuity of a moving image as much as possible. In order to achieve this object, an image reproduction apparatus includes a buffer which temporarily stores an encoded image data stream, a buffer size setting circuit which sets the storage size of the buffer, a decoding time calculation circuit which calculates a decoding time at which the encoded image data stream is output from the buffer to a decoder, and a control circuit which controls to set the storage size of the buffer to at least twice the maximum value of a storage size required by an encoded data stream reproducible by the image reproduction apparatus, start fetching a second encoded image data stream in the buffer immediately after fetch of a first encoded image data stream in the buffer is ended, and calculate the decoding time of the second image data stream on the basis of a time when fetch of the first image data stream in the buffer is ended.

FIELD OF THE INVENTION

The present invention relates to a technique of reproducing an imageand, more particularly, to a technique of reproducing moving image datausing inter-frame encoding.

BACKGROUND OF THE INVENTION

In recent years, digital video cameras and. digital cameras which encodemoving image data by using inter-frame encoding such as MPEG andrecord/reproduce the data are widely used.

In encoding image data by using MPEG, it is done in accordance with avirtual buffer model called vbv_buffer in order to guarantee thatencoded image data will be decoded by a decoder without any loss. Thedecoder decodes image data input from a recording medium or transmissionline in accordance with the vbv_buffer model.

An operation of reproducing, from a recording medium, image data encodedby MPEG and decoding it will be described with reference to FIGS. 5A to5C and 6.

FIG. 6 is a block diagram showing an example of a reproductionapparatus. When a reproduction instruction is input, a control circuit507 shown in FIG. 6 instructs a reproduction circuit 502 to reproduce,reads out a stream A of MPEG data recorded on a recording medium 501,and writes reproduced data in a buffer 503. As shown in FIG. 5A, thecontrol circuit 507 reads out the stream A from the recording medium 501at time t_(α) and writes it in the buffer 503. The control circuit 507notifies a decoding time calculation circuit 506 of the fetch time t_(α)in the buffer 503.

At time t₀ shown in FIG. 5A, the control circuit 507 reads out firstimage data V₀ from the buffer 503 and sends the data to a decoder (notshown).

On the basis of vbv_delayA(0) detected by a vbv_delay detection circuit504, the decoding time calculation circuit 506 calculates the time togiven byt ₀ =t _(α)+vbv_delayA(0)   (1)The vbv_delay data is information representing a time during which eachpicture data of an MPEG stream stays in the buffer memory when thepicture data is to be decoded.

The decoding time t₀ calculated by the decoding time calculation circuit506 is supplied to the control circuit 507. At the time to, the controlcircuit 507 reads out the reproduced data V₀ of the stream A from thebuffer 503 and outputs the data from an output terminal 508 to a decoder(not shown).

Decoding time t_(q) from the time t₀ is calculated by the decoding timecalculation circuit 506 byt _(q) =t ₀ +T _(V) ×q(q=0, 1, 2, . . . )   (2)and supplied to the control circuit 507, where T_(v) is the reciprocalof the frame frequency (e.g., 29.97 Hz) of the image data.

When the time t₀ has come, the control circuit 507 notifies the decodingtime calculation circuit 506 of it. The decoding time calculationcircuit 506 supplies next decoding time t₁ to the control circuit 507.

At the time t₁, the control circuit 507 reads out V₁ of the stream A ofthe reproduced data fetched in the buffer 503, outputs the data to theoutput terminal 508, and sends it to the decoder (not shown).

In the above-described way, the image data is reproduced until times t₂,t₃, . . . , t₀ so that reproduction of the stream A is ended.

The encoder must encode image data without causing overflow or underflowof the above-described vbv_buffer model. The decoder can decode imagedata without any failure such as frame skip or frame hold by executingreproduction in accordance with the vbv_buffer model.

Consider a case wherein another stream B is reproduced next to thestream A recorded on the recording medium.

To reproduce without causing overflow or underflow of the vbv_buffermodel on the decoder side, the control circuit 507 controls thereproduction circuit 502 and buffer 503 such that after the finalreproduced data of the stream A is read out from the buffer 503 atdecoding time t_(n) the data of the stream B is fetched in the buffer503, as shown in FIG. 5B.

The control circuit 507 notifies the decoding time calculation circuit506 of the fetch time t_(n) of the stream B and fetches the stream B inthe buffer 503 through the reproduction circuit 502.

The vbv_delay detection circuit 504 detects vbv_delayB(0) and suppliesit to the decoding time calculation circuit 506. On the basis of thefetch time t_(n) and vbv_delayB(0), the decoding time calculationcircuit 506 calculates a decoding time t_(n) given byt _(n) =t _(n) +vbv_delayB(0)   (3)(t_(n+3)=t_(n) FIG. 5B) and supplies the decoding time t to the controlcircuit 507.

The decoding time of the stream B is calculated by the decoding timecalculation circuit 506 byt _(r) =t _(n) +T _(v) ×r (r=0, 1, 2, . . . )   (4)The control circuit 507 controls the fetch/read in/from the buffer inthe same way as for the stream A, as shown in FIG. 5B.

In the above-described method, neither buffer overflow nor underflowoccurs because the stream B is fetched in the buffer 503 after thestream A is completely read out from the buffer 503 at the decoding timeof the last data of the stream A. However, since decoding cannot beexecuted at the reproduction transition from the stream A to the streamB, i.e., at times t_(n+1) and t_(n+2), the reproduced image of thestream A cannot smoothly be switched to that of the stream B. That is,the continuity of a reproduced image is disrupted.

To solve this problem, Japanese Patent Laid-Open No. 2002-158968proposes a technique in which fetch of the stream B in the buffer 503 isstarted from an end time t_(e) of fetch of the stream A in the buffer503, as shown in FIG. 5C, to speed up fetch in the buffer 503 whilestopping fetch in the buffer 503 if overflow is going to occur. Thedecoding time of the stream B is set at t_(s) in FIG. 5C to shorten thetime of discontinuity of a reproduced image (the time while thecontinuity of decoding times is damaged) as much as possible.

Although this method can solve the problem of interruption of thediscontinuity of a reproduced image, there is still room forimprovement.

SUMMARY OF THE INVENTION

The present invention has been in consideration of the above-describedproblems, and has as its object to suppress discontinuity of a movingimage as much as possible in continuous reproduction of the movingimage.

In order to solve the above-described problem and achieve the object,according to the first aspect of the present invention, there isprovided an image reproduction apparatus comprising: a reproducingdevice which reproduces an image data stream encoded by usinginter-frame encoding; a buffer device which temporarily stores theencoded image data stream reproduced by the reproducing device; a buffersize setting device which sets an amount of image data which can bestored in the buffer device; a decoding time calculation device whichcalculates a decoding time as a timing at which the encoded image datastream is output from the buffer device to a decoder; and a controldevice which controls the buffer device, the buffer size setting device,and the decoding time calculation device to set the amount of image datawhich can be stored in the buffer device to at least twice a maximumvalue of an amount required by an encoded data stream reproducible bythe image reproduction apparatus, start storing a second encoded imagedata stream in the buffer device after storage of a first encoded imagedata stream in the buffer device is ended before the first image datastream is completely output to the decoder, and calculate a decodingtime of the second image data stream on the basis of a time when storageof the first image data stream in the buffer device is ended. Accordingthe second aspect of the present invention, there is provided an imagereproduction apparatus comprising: a reproducing device which reproducesan image data stream encoded by using inter-frame encoding; a bufferdevice which temporarily stores the encoded image data stream reproducedby the reproduction device; a buffer size setting device which sets anamount of image data which can be stored in the buffer device; adecoding time calculation device which calculates a decoding time as atiming at which the encoded image data stream is output from the bufferdevice to a decoder; and a control device which controls the bufferdevice, the buffer size setting device, and the decoding timecalculation device to set a storage size required by a first encodedimage data stream as the storage size of the buffer device, startfetching a second encoded image data stream in the buffer deviceimmediately after fetch of the first image data stream in the bufferdevice is ended, set again a sum of a value of a storage size requiredby the second image data stream and a value of the storage size requiredby the preceding first image data stream as the storage size of thebuffer device, and calculate a decoding time of the second image datastream on the basis of a time when fetch of the first image data streamin the buffer device is ended. According to the third aspect of thepresent invention, there is provided a method of controlling an imagereproduction apparatus including a reproducing device which reproducesan image data stream encoded by using inter-frame encoding, a bufferdevice which temporarily stores an encoded image data stream reproducedby the reproducing device, a buffer size setting device which sets anamount of image data which can be stored in the buffer device, and adecoding time calculation device which calculates a decoding time as atiming at which the encoded image data stream is output from the bufferdevice to a decoder, comprising: a buffer size setting step of causingthe buffer size setting device to set the storage size of the bufferdevice to at least twice a maximum value of a storage size required byan encoded data stream reproducible by the image reproduction apparatus;a data fetch step of starting fetching a second encoded image datastream in the buffer device immediately after fetch of a first encodedimage data stream in the buffer device is ended; and a decoding timecalculation step of causing the decoding time calculation device tocalculate a decoding time of the second image data stream on the basisof a time when fetch of the first image data stream in the buffer deviceis ended. According to the fourth aspect of the present invention, thereis provided a method of controlling an image reproduction apparatusincluding a reproducing device which reproduces an image data streamencoded by using inter-frame encoding, a buffer device which temporarilystores an encoded image data stream reproduced by the reproductiondevice, a buffer size setting device which sets an amount of image datawhich can be stored in the buffer device, and a decoding timecalculation device which calculates a decoding time as a timing at whichthe encoded image data stream is output from the buffer device to adecoder, comprising: a buffer size setting step of causing the buffersize setting device to set a storage size required by a first encodedimage data stream as the storage size of the buffer device; a data fetchstep of starting fetching a second encoded image data stream in thebuffer device immediately after fetch of the first image data stream inthe buffer device is ended; a buffer size re-setting step of settingagain a sum of a value of a storage size required by the second imagedata stream and a value of the storage size required by the precedingfirst image data stream as the storage size of the buffer device; and adecoding time calculation step of causing the decoding time calculationdevice to calculate a decoding time of the second image data stream onthe basis of a time when fetch of the first image data stream in thebuffer device is ended. According to the fifth aspect of the presentinvention, there is provided a program characterized by causing acomputer to execute the above control method.

According to the sixth aspect of the present invention, there isprovided a computer-readable storage medium characterized by storing theabove program.

Other objects and advantages besides those discussed above shall beapparent to those skilled in the art from the description of a preferredembodiment of the invention which follows. In the description, referenceis made to accompanying drawings, which form a part hereof, and whichillustrate an example of the invention. Such example, however, is notexhaustive of the various embodiments of the invention, and thereforereference is made to the claims which follow the description fordetermining the scope of the invention.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a block diagram showing the arrangement of an imagereproduction apparatus according to the first embodiment of the presentinvention;

FIG. 2 is a block diagram showing the arrangement of an imagereproduction apparatus according to the second embodiment of the presentinvention;

FIG. 3 is a block diagram showing the arrangement of an imagereproduction apparatus according to the third embodiment of the presentinvention;

FIG. 4 is a timing chart for explaining a moving image data buffer modelin the image reproduction apparatus of the present invention;

FIGS. 5A to 5C are timing charts for explaining conventional movingimage data buffer models; and

FIG. 6 is a block diagram for explaining a conventional moving imagedata recording format.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

Preferred embodiments of the present invention will be described belowin detail with reference to the accompanying drawings.

(First Embodiment)

FIG. 1 is a block diagram showing the arrangement of an imagereproduction apparatus according to the first embodiment of the presentinvention.

Referring to FIG. 1, reference numeral 101 denotes a recording medium;102, a reproduction circuit; 103, a buffer memory; 104, a decoder; 104a, a decoded data output terminal; 105, a buffer occupation amountdetection circuit; 106, a buffer size detection circuit; 107, avbv_delay detection circuit which detects vbv_delay data added to eachpicture data from reproduced stream data; 108, a buffer fetch startdetection circuit; 109, a buffer fetch end detection circuit; 110, adecoding time calculation circuit; 111, a buffer size determinationcircuit; and 112, a control circuit.

When the reproduction mode starts, the buffer size determination circuit111 sends, to the control circuit 112, a maximum value VF_(max) of thebuffer size processible by the image reproduction apparatus of thisembodiment. The control circuit 112 calculates a value twice the maximumvalue VF_(max) of the buffer size input from the buffer sizedetermination circuit 111 byVS=VF _(max)×2   (5)to set a size (storable data amount) VS of the buffer memory 103.

Upon receiving a reproduction instruction, the control circuit 112controls the reproduction circuit 102 to reproduce a designated stream Afrom the recording medium 101. The reproduction circuit 102 reads outthe data of the stream A from the recording medium 101 and writes thedata in the buffer memory 103. FIG. 4 shows simulation of reproduceddata stored in the buffer memory 103.

The control circuit 112 reads out the stream A from the recording mediumthrough the reproduction circuit 102 and writes the readout data in thebuffer memory 103 until time t₀ shown in FIG. 4. At the time t₀, data V₀of the stream A stored in the buffer memory 103 is read out, andsupplied to a decoder 104 Output data from the decoder 104 are output tothe output terminal 104 a.

The time t₀ is calculated by the decoding time calculation circuit 110in the following way.

The vbv_delay detection circuit 107 in FIG. 1 detects vbv_delayA(0) ofthe first frame of the stream A and supplies vbv_delayA(0) to thedecoding time calculation circuit 110. The buffer fetch start detectioncircuit 108 detects start time t_(α) of fetch of the stream A in thebuffer memory 103 and supplies the fetch start time t_(α) to thedecoding time calculation circuit 110. On the basis of the time t_(α)and vbv_delayA(0), the decoding time calculation circuit 110 calculatesthe time to given byt ₀ =t _(α) +vbv_delayA(0)   (1)and supplies the decoding start time to of the first frame other controlcircuit 112. At the time t₀, the control circuit 112 reads out the dataV₀ of the first frame of the stream A from the buffer memory 103,supplies the data V₀ to the decoder 104.

Decoding time t_(q) from the time t₀ shown in FIG. 4 is calculated bythe decoding time calculation circuit 506 byt _(q) =t ₀ +T _(v) ×q(q =0, 1, 2, . . . )   (2)and supplied to the control circuit 507, where T_(v) is the reciprocalof the frame frequency (e.g., 29.97 Hz) of the image data.

The control circuit 112 controls the reproduction circuit 102 tocontinuously reproduce the stream A from the recording medium 101 andwrite it in the buffer memory 103 even after the time t₀. On the basisof the decoding time supplied from the decoding time calculation circuit110, reproduced data V₁, V₂, . . . are read out from the buffer memory103 at times t₁, t₂, . . . , and supplied to the decoder 104.

As shown in FIG. 4, the read of the stream A from the recording medium101 is ended at time t_(e). In this embodiment, at this point of time,the control circuit 112 controls the reproduction circuit 102 to readout next stream B from the recording medium 101 and write it in thebuffer memory 103 (a solid line after the time t_(e) in FIG. 4).

The buffer size detection circuit 106 detects vbv_buffer_size(=v_size(B)) data in the sequence header at the start of the stream Band checks whether the sum of the vbv_buffer_size (=v_size(B)) data andvbv_buffer_size (=V_size(A)) data of the stream A exceeds the set sizeVS of the buffer memory 103.

The vbv_buffer_size data is described in the sequence header of anelementary stream in an MPEG stream. A sequence header is headerinformation inserted in the sequence layer of an elementary stream inMPEG data. The vbv_buffer_size data is added to, e.g., each data of oneGOP and indicates the maximum occupation data amount of the buffermemory in decoding the data of the sequence layer. Hence, at the time ofdecoding, data stored in the buffer memory never exceedsvbv_buffer_size.

The buffer occupation amount detection circuit 105 detects theoccupation amount of reproduced data in the buffer memory 103 andnotifies the control circuit 112 of the occupation amount. The controlcircuit 112 monitors whether the buffer occupation amount supplied fromthe buffer occupation amount detection circuit 105 exceeds the buffersize VS set for the buffer memory 103. If the occupation amount is goingto exceed the buffer size VS, reproduction from the recording medium isstopped to interrupt data fetch in the buffer memory 103.

It is checked from this point of time whether the sum of v_size(B) andthe data amount of the stream A stored in the buffer memory 103 exceedsthe set size VS. When the sum becomes smaller than the set size VS, theread of the data of the stream B from the recording medium is started.

As shown in FIG. 4, the control circuit 112 reads out reproduced dataV_(n−2) and V_(n−1) of the stream A at times t_(n−2) and t_(n−1),respectively. Finally, reproduced data V_(n) of the stream A is read outfrom the buffer memory 103 at time t_(n), and reproduction of the streamA to the decoder 104 is ended.

The vbv_delay detection circuit 107 detects the vbv_delay value(=vbv_delayB(0)) on the basis of vbv_delay data of the first frame ofthe stream B and supplies the vbv_delay value to the decoding timecalculation circuit 110. The buffer fetch end detection circuit 109detects the end time t_(e) (time t_(e) in FIG. 4) of the read of thestream A from the recording medium 101 and supplies the time t_(e) tothe decoding time calculation circuit 110.

The decoding time calculation circuit 110 calculatest _(y) =t _(e) +vbv_delayB(0)   (6)and supplies the time t_(y) to the control circuit 112.

If the time t_(y) satisfies(t _(y) −t ₀) mod (T _(v))≠0   (7)(A mod B indicates the remainder obtained by dividing A by B), thecontrol circuit 112 stops reading the stream B from the recording medium101 to interrupt the write in the buffer memory 103 at the time t_(y)(the time from the time t_(y) to time t_(n+1) in FIG. 4). At the timet_(n+1), the read of the data of the stream B from the recording mediumis started again. Ift_(y)≦t_(n+1)   (8)the decoding time calculation circuit 110 calculates a decoding starttime t_(k) of the stream B byt_(k)=t_(n+1)   (9)

The time t_(n+1) and the read time t_(n) of the last data V_(n) of thestream A from the buffer memory 103 have a relationship given byt _(n+1) =t _(n) +T _(v)   (10)

Decoding time t_(n) after the time t_(k) of the stream B (timet_(n+1)(=t_(n)+T_(y))) is given byt _(u) =t _(k) +T _(v) ×u (u=0, 1, 2, . . . )   (11)Whent_(y)>t_(n+1)   (12)and expression (7) holds, we have $\begin{matrix}{t_{k} = {t_{0} + \left\lbrack {t_{y} - t_{0} - \left( {\left( {t_{y} - t_{0}} \right)\quad{mod}\quad\left( T_{v} \right)} \right)} \right\rbrack + T_{v}}} & (12)\end{matrix}$When(t _(y) −t ₀) mod (T _(y))=0   (13)we havet _(k) =t ₀ +[t _(y) t ₀ ]=t _(y)   (14 )

Hence, the decoding time t_(u) of the stream B after the time t_(k) isgiven byt _(u) =t _(k) +T _(v) ×u (u= 0, 1, 2, . . . )   (11)

The decoding time calculation circuit 110 calculates the decoding timet_(u) of the stream B in the above-described way and supplies the timet_(u) to the control circuit 112. The control circuit 112 reads out thereproduced data of the stream B from the buffer memory 103 in accordancewith the decoding time from the decoding time calculation circuit 110and supplies the reproduced data to the decoder 104. In other words, thecontrol circuit 112 controls the buffer memory 103 to read outreproduced data from the buffer memory 103 in accordance with thedecoding time (times t_(n+1)(t_(k)), t_(n+1)(t_(k)+T_(v)×u), . . . ,t_(u), . . . in FIG. 4), outputs the reproduced data to the decoder 104.

As described above, in this embodiment, a size at least twice the buffermemory occupation data amount vbv_buffer_size of MPEG data processibleby the reproduction apparatus is set as the size of the buffer memory inthe reproduction mode. When the stream B is to be reproduced from therecording medium next to the stream A, the time t_(e) at which the lastdata of the reproduced data of the preceding stream A is read out fromthe recording medium is detected. From the read end time t_(e), fetch ofthe reproduced data of the next stream B in the buffer memory isstarted.

That is, the apparatus is designed such that even when data stored inthe buffer memory 103 exceeds vbv_buffer_size, the data of the stream Bcan be stored in the buffer memory 103. In addition, the decoding starttime of the first frame of the stream B is calculated from the read endtime t_(e) of the data of the final frame of the stream A. Discontinuitywhich occurs when the reproduced image of the stream A is switched tothat of the stream B can be minimized. Hence, discontinuity of a movingimage can also be minimized (in this embodiment, when t_(y)≦t_(n+1), thecontinuity of decoding times is maintained, as shown in FIG. 4, and amoving image is smoothly reproduced).

(Second Embodiment)

FIG. 2 is a block diagram showing the arrangement of an imagereproduction apparatus according to the second embodiment of the presentinvention.

Referring to FIG. 2, reference numeral 101 denotes a recording medium;102, a reproduction circuit; 103, a buffer memory; 104, a decoder; 104a, a decoded data output terminal; 105, a buffer occupation amountdetection circuit; 106, a buffer size detection circuit; 108, a bufferfetch start detection circuit; 109, a buffer fetch end detectioncircuit; 111, a buffer size determination circuit; 112, a controlcircuit; 201, a bit rate detection circuit; and 202, a decoding timecalculation circuit.

The same reference numerals as in FIG. 1 of the first embodiment denoteparts having the same functions in FIG. 2. Only portions different fromthe first embodiment will be described below.

When reproduction from the recording medium 101 is started to fetch astream A in the buffer memory 103, the buffer size detection circuit 106detects vbv_buffer_size (=v_size(A)) described in the sequence header ofan elementary stream in the stream A and supplies the size to thedecoding time calculation circuit 202. The bit rate detection circuit201 detects a bit rate Ra on the basis of bit rate information of thestream A described in the sequence header in the stream A and suppliesthe bit rate Ra to the decoding time calculation circuit 202. The bufferfetch start detection circuit 108 detects a fetch start time t_(a) ofthe stream A in the buffer memory 103 and supplies the time to thedecoding time calculation circuit 202.

The decoding time calculation circuit 202 calculates a decoding starttime t₀ of the first frame of the stream A byt ₀ =t _(α) +v_size(A)/Ra   (14)and supplies the decoding time to t₀ the control circuit 112.

The value v_size(A)/Ra indicates a time required from the start ofstorage of data at the bit rate Ra in the buffer memory 103 untilstorage of data in V_size(A).

Decoding time t_(q) from the time t₀ is calculated by the decoding timecalculation circuit 202 byt _(q) =t ₀ +T _(y) ×q(q=0, 1, 2, . . . )   (2)and supplied to the control circuit 112.

The buffer fetch end detection circuit 109 detects a data fetch end timet_(e) of the stream A in the buffer memory 103 and supplies the timet_(e) to the decoding time calculation circuit 202 and control circuit112.

The buffer size detection circuit 106 detects vbv_buffer_size(=v_size(B)) of a stream B and supplies it to the decoding timecalculation circuit 202. The bit rate detection circuit 201 detects abit rate Rb and supplies it to the decoding time calculation circuit202.

The decoding time calculation circuit 202 calculatest _(y) =t _(e) +v_size(B)/Rb   (15)and supplies the time t to the control circuit 112.

Calculation of a decoding start time t_(k) and decoding time t_(u) ofthe stream B and the method of fetching/reading the stream B in/from thebuffer memory are the same as in the first embodiment.

As described above, a size at least twice the maximum buffer sizevbv_buffer_size processible by the reproduction apparatus is prepared inthe buffer memory, as in the first embodiment. The time t_(e) at whichthe last data of the reproduced data of the preceding stream A is readout from the recording medium is detected. From the read end time t_(e),fetch of the reproduced data of the next stream B in the buffer memoryis started. That is, even when the fetch amount in the buffer memoryexceeds vbv_buffer_size, the data of the stream B can be fetched in thebuffer memory. The reproduction time of the stream B is recalculated onthe basis of the read end time t_(e), the bit rate of the stream B, andvbv_buffer_size. Hence, discontinuity of decoding times can be minimizedat the reproduction transition from the stream A to the stream B.Discontinuity of a moving image can also be minimized (in thisembodiment, when t_(y)≦t_(n+1), the continuity of decoding times ismaintained, as shown in FIG. 4, and a moving image is smoothlyreproduced).

(Third Embodiment)

FIG. 3 is a block diagram showing the arrangement of an imagereproduction apparatus according to the third embodiment of the presentinvention.

Referring to FIG. 3, reference numeral 101 denotes a recording medium;102, a reproduction circuit; 103, a buffer memory; 104, a decoder; 104a, a decoded data output terminal; 105, a buffer occupation amountdetection circuit; 106, a buffer size detection circuit; 107, avbv_delay detection circuit; 108, a buffer fetch start detectioncircuit; 109, a buffer fetch end detection circuit; 110, a decoding timecalculation circuit; 301, a buffer size determination circuit; and 302,a control circuit.

The same reference numerals as in FIG. 1 of the first embodiment denoteparts having the same functions in FIG. 3. Only portions different fromthe first embodiment will be described below.

When reproduction of a stream A recorded on the recording medium 101starts, the buffer size detection circuit 106 detects vbv_buffer_size(=v_size(A)) of the stream A and supplies it to the buffer sizedetermination circuit 301. The buffer size determination circuit 301calculates the value vbv_buffer_size=v_size(A) of the stream A byVsize=v_size(A)   (16)and supplies the value Vsize to the control circuit 302.

The control circuit 302 sets the value Vsize (=v_size(A)) as the size ofthe buffer memory 103.

Derivation of a reproduction start time to and decoding time t_(q) ofthe stream A and buffer fetch/read control are the same as in the firstor second embodiment.

When fetch of a stream B in the buffer memory 103 starts at a fetch endtime t_(e) of the stream A in the buffer memory 103, the buffer sizedetection circuit 106 detects vbv_buffer_size (=v_size(B)) of the streamB and supplies it to the buffer size determination circuit 301.

The buffer size determination circuit 301 calculates the sum of thevalue vbv_buffer_size=v_size(A) of the stream A and the valuevbv_buffer_size=v_size(B) of the stream B byVsize=v_size(A)+v_size(B)   (17)and supplies the value Vsize to the control circuit 302.

The control circuit 302 sets the value Vsize (=v_size(A)+v_size(B))again as the size of the buffer memory 103.

Read control of the stream A, buffer fetch/read control of the stream B,and calculation of a decoding start time t_(k) and decoding time t_(u)are the same as in the first or second embodiment.

At a read end time t_(n) of last data V_(n) of the stream A from thebuffer memory 103, the control circuit 302 notifies the buffer sizedetermination circuit 301 that sweep of the stream A from the buffermemory 103 is ended.

Upon recognizing that sweep of the stream A from the buffer memory 103is ended, on the basis of vbv_buffer_size=v_size(B) of the stream B, thebuffer size determination circuit 301 sets Vsize asVsize=v_size(B)   (18)and supplies the value to the control circuit 302.

The control circuit 302 sets Vsize=v_size(B) supplied from the buffersize determination circuit 301 again as the size of the buffer memory103.

Buffer fetch/read control of the stream B from the time t_(n) andcalculation of the decoding start time t_(k) and decoding time t_(u) arethe same as in the first or second embodiment.

As described above, in seamless reproduction, vbv_buffer_size=v_size(A)of the preceding stream A is detected. While only the reproduced data ofthe stream A is present in the buffer memory, the buffer size is set tovbv_buffer_size=v_size(A) of the stream A. The time t_(e) at which thelast data of the stream A is read out from the recording medium isdetected. From the fetch end time t_(e), fetch of the next stream B inthe buffer memory is started. Then, vbv_buffer_size=v_size(B) of thestream B is detected. While both the stream A and the stream B arepresent in the buffer memory, the buffer size is set again tov_size(A)+v_size(B). With this arrangement, even when the fetch amountof the stream B in the buffer memory exceeds vbv_buffer_size, the datacan be fetched in the buffer memory. The reproduction time of the streamB is recalculated on the basis of the read end time t_(e) of the streamA. Hence, discontinuity of decoding times can be minimized at thereproduction transition from the stream A to the stream B. Discontinuityof a moving image can also be minimized (in this embodiment, whent_(y)≦t_(n+1), the continuity of decoding times is maintained, as shownin FIG. 4, and a moving image is smoothly reproduced).

As described above, according to the above-described embodiments, incontinuous reproduction of a moving image, discontinuity of the movingimage can be suppressed as much as possible.

(Other Embodiment)

The object of the embodiments can also be achieved by supplying astorage medium (or recording medium) which records software programcodes for implementing the functions of the above-described embodimentsto a system or apparatus and causing the computer (or CPU or MPU) of thesystem or apparatus to read out and execute the program codes stored inthe storage medium. In this case, the program codes read out from thestorage medium implement the functions of the above-describedembodiments by themselves, and the storage medium which stores theprogram codes constitutes the present invention. The functions of theabove-described embodiments are implemented not only when the readoutprogram codes are executed by the computer but also when the operatingsystem (OS) running on the computer performs part or all of actualprocessing on the basis of the instructions of the program codes.

The functions of the above-described embodiments are also implementedwhen the program codes read out from the storage medium are written inthe memory of a function expansion card inserted into the computer or afunction expansion unit connected to the computer, and the CPU of thefunction expansion card or function expansion unit performs part or allof actual processing on the basis of the instructions of the programcodes.

When the present invention is applied to the storage medium, programcodes corresponding to the above-described procedures are stored in thestorage medium.

The present invention is not limited to the above embodiments andvarious changes and modifications can be made within the spirit andscope of the present invention. Therefore, to apprise the public of thescope of the present invention, the following claims are made.

CLAIM OF PRIORITY

This application claims priority from Japanese Patent Application No.2004-244126 filed on Aug. 24, 2004, which is hereby incorporated byreference herein.

1. An image reproduction apparatus, comprising: a reproducing devicewhich reproduces an image data stream encoded by using inter-frameencoding; a buffer device which temporarily stores the encoded imagedata stream reproduced by said reproducing device; a buffer size settingdevice which sets an amount of image data which can be stored in saidbuffer device; a decoding time calculation device which calculates adecoding time as a timing at which the encoded image data stream isoutput from said buffer device to a decoder; and a control device whichcontrols said buffer device, said buffer size setting device, and saiddecoding time calculation device to set the amount of image data whichcan be stored in said buffer device to at least twice a maximum value ofan amount required by an encoded data stream reproducible by said imagereproduction apparatus, start storing a second encoded image data streamin said buffer device after storage of a first encoded image data streamin said buffer device is ended before the first image data stream iscompletely output to the decoder, and calculate a decoding time of thesecond image data stream on the basis of a time when storage of thefirst image data stream in said buffer device is ended.
 2. The apparatusaccording to claim 1, wherein the encoded image data stream is an MPEGdata stream.
 3. The apparatus according to claim 1, wherein saiddecoding time calculation device calculates the decoding time on thebasis of data delay information contained in the encoded image datastream.
 4. The apparatus according to claim 3, wherein the data delayinformation contained in the encoded image data stream is vbv_delay. 5.The apparatus according to claim 1, wherein said decoding timecalculation device calculates the decoding time on the basis of storageamount information contained in the encoded image data stream and a bitrate of the encoded image data stream.
 6. The apparatus according toclaim 5, wherein the storage amount information contained in the encodedimage data stream is vbv_buffer_size.
 7. An image reproductionapparatus, comprising: a reproducing device which reproduces an imagedata stream encoded by using inter-frame encoding; a buffer device whichtemporarily stores the encoded image data stream reproduced by saidreproduction device; a buffer size setting device which sets an amountof image data which can be stored in said buffer device; a decoding timecalculation device which calculates a decoding time as a timing at whichthe encoded image data stream is output from said buffer device to adecoder; and a control device which controls said buffer device, saidbuffer size setting device, and said decoding time calculation device toset a storage size required by a first encoded image data stream as thestorage size of said buffer device, start fetching a second encodedimage data stream in said buffer device immediately after fetch of thefirst image data stream in said buffer device is ended, set again a sumof a value of a storage size required by the second image data streamand a value of the storage size required by the preceding first imagedata stream as the storage size of said buffer device, and calculate adecoding time of the second image data stream on the basis of a timewhen fetch of the first image data stream in said buffer device isended.
 8. The apparatus according to claim 7, wherein the encoded imagedata stream is an MPEG data stream.
 9. The apparatus according to claim7, wherein said decoding time calculation device calculates the decodingtime on the basis of data delay information contained in the encodedimage data stream.
 10. The apparatus according to claim 9, wherein thedata delay information contained in the encoded image data stream isvbv_delay.
 11. The apparatus according to claim 7, wherein said decodingtime calculation device calculates the decoding time on the basis ofstorage amount information contained in the encoded image data streamand a bit rate of the encoded image data stream.
 12. The apparatusaccording to claim 11, wherein the storage amount information containedin the encoded image data stream is vbv_buffer_size.
 13. A method ofcontrolling an image reproduction apparatus including a reproducingdevice which reproduces an image data stream encoded by usinginter-frame encoding, a buffer device which temporarily stores anencoded image data stream reproduced by said reproducing device, abuffer size setting device which sets an amount of image data which canbe stored in the buffer device, and a decoding time calculation devicewhich calculates a decoding time as a timing at which the encoded imagedata stream is output from the buffer device to a decoder, comprising: abuffer size setting step of causing the buffer size setting device toset the storage size of the buffer device to at least twice a maximumvalue of a storage size required by an encoded data stream reproducibleby the image reproduction apparatus; a data fetch step of startingfetching a second encoded image data stream in the buffer deviceimmediately after fetch of a first encoded image data stream in thebuffer device is ended; and a decoding time calculation step of causingthe decoding time calculation device to calculate a decoding time of thesecond image data stream on the basis of a time when fetch of the firstimage data stream in the buffer device is ended.
 14. The methodaccording to claim 13, wherein the encoded image data stream is an MPEGdata stream.
 15. The method according to claim 13, wherein in thedecoding time calculation step, the decoding time is calculated on thebasis of data delay information contained in the encoded image datastream.
 16. The method according to claim 15, wherein the data delayinformation contained in the encoded image data stream is vbv_delay. 17.The method according to claim 13, wherein in the decoding timecalculation step, the decoding time is calculated on the basis ofstorage amount information contained in the encoded image data streamand a bit rate of the encoded image data stream.
 18. The methodaccording to claim 17, wherein the storage amount information containedin the encoded image data stream is vbv_buffer_size.
 19. A method ofcontrolling an image reproduction apparatus including a reproducingdevice which reproduces an image data stream encoded by usinginter-frame encoding, a buffer device which temporarily stores anencoded image data stream reproduced by said reproduction device, abuffer size setting device which sets an amount of image data which canbe stored in the buffer device, and a decoding time calculation devicewhich calculates a decoding time as a timing at which the encoded imagedata stream is output from the buffer device to a decoder, comprising: abuffer size setting step of causing the buffer size setting device toset a storage size required by a first encoded image data stream as thestorage size of the buffer device; a data fetch step of startingfetching a second encoded image data stream in the buffer deviceimmediately after fetch of the first image data stream in the bufferdevice is ended; a buffer size re-setting step of setting again a sum ofa value of a storage size required by the second image data stream and avalue of the storage size required by the preceding first image datastream as the storage size of the buffer device; and a decoding timecalculation step of causing the decoding time calculation device tocalculate a decoding time of the second image data stream on the basisof a time when fetch of the first image data stream in the buffer deviceis ended.
 20. The method according to claim 19, wherein the encodedimage data stream is an MPEG data stream.
 21. The method according toclaim 19, wherein in the decoding time calculation step, the decodingtime is calculated on the basis of data delay information contained inthe encoded image data stream.
 22. The method according to claim 21,wherein the data delay information contained in the encoded image datastream is vbv_delay.
 23. The method according to claim 19, wherein inthe decoding time calculation step, the decoding time is calculated onthe basis of storage amount information contained in the encoded imagedata stream and a bit rate of the encoded image data stream.
 24. Themethod according to claim 23, wherein the storage amount informationcontained in the encoded image data stream is vbv_buffer_size.
 25. Aprogram causing a computer to execute a control method of claim
 13. 26.A computer-readable storage medium storing a program of claim 25.